package com.ems.controller;

import com.ems.entity.TMenu;
import com.ems.entity.TMenuRole;
import com.ems.service.TMenuRoleService;
import com.ems.service.TMenuService;
import com.ems.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ZZH
 * @since 2022-06-27
 */
@RestController
@RequestMapping("/t-menu-role")
public class TMenuRoleController {
    @Autowired
    private TMenuRoleService tMenuRoleService;

    //修改数据
    @PostMapping("/update")
    public ResultUtil updateUser(TMenuRole tMenuRole) {
        if (tMenuRoleService.update(tMenuRole)) {
            return ResultUtil.success(tMenuRoleService.update(tMenuRole));
        } else {
            return ResultUtil.fail("修改失败");
        }
    }
}
